<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<link href="./css/modern.css" rel="stylesheet"> 
<link href="./css/style-extra-large.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<script>
function ViewValidation()
{
	var radios = document.getElementsByName('courseNumber');
	for(var i =0; i< radios.length; i++)
	{
		if(radios[i].checked){
			return true;
		}
	}
	
	alert("Please Select a COGS to View!");
	return false;
}

</script>
<%@ page import="java.util.ArrayList"%>
<%@ page import="com.eece496.Helpers.TADutiesInfo"%>
<%
	String empty = (String) request.getAttribute("empty");
	String firstname = (String) request.getAttribute("firstname");
	String lastname = (String) request.getAttribute("lastname");
	String courseNumber = (String) request.getAttribute("courseNumber");
	String sectionNumber = (String) request.getAttribute("sectionNumber");
	String TAID = (String) request.getAttribute("TAID");
	ArrayList<TADutiesInfo> TAInfo = (ArrayList<TADutiesInfo>) request.getAttribute("TADutyInfo");
	ArrayList<TADutiesInfo> cInfo = (ArrayList<TADutiesInfo>) request.getAttribute("CompleteInfo");
%>
<body>
<div id="container">
	<div id="header"><br>
		<h1 id="main-title"><b><font color = "000000">EECE Student Group Assessments</b></font></h1>
		<h2>
			<a href="index.html">
			<p align="right"><font size = "5">Logout</font></p>
			</a>
		</h2>		
	</div>
    <div id="body" class="page-region-content tiles">
                <form id=form method="get" action="TACourseServlet">
             	<a href = "javascript:;" onclick="document.getElementById('form').submit();" class="back-button big page-back">
             		<input type = "hidden" name = "firstname" value = <%=firstname%>>
					<input type = "hidden" name = "lastname" value = <%=lastname%>>	
					<input type = "hidden" name = "TAID" value = "<%=TAID%>">
					<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
					<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>
             	</a>
            </form>
     <div id="innerBody" class="page-region-content tiles">
		<h1>COGS Duties for <%=courseNumber%> Section <%=sectionNumber%></h1><br>

<form action="TAMakeAssessmentsServlet" id="myform" method="get">
<table cellspacing="0" cellpadding="0" border="0" width="325" class="striped" border=1>
  <tr>
    <td>
       <table cellspacing="0" cellpadding="1" border="0" width="300"class="striped" border=1 >
         <tr>
            <th>Pending Assessments</th>
         </tr>
       </table>
    </td>
  </tr>
  <tr>
    <td>
       <div style="100%; height:250px; width: 1000px; overflow:auto;">
         <table class="fixed" cellspacing="0" cellpadding="1" border="0" width="300" class="striped" border=1>
           <tr>
           		<td><b></b></td>
				<td><b>COGS name</b></td>
				<td><b>Division </b></td>
				<td><b>Student Names</b></td>
				<td><b>Group Number</b></td>
				<td><b>Questions</b></td>
				<td><b>Room</b></td>
				<td><b>Start Time</b></td>
				<td><b>End Time</b></td>
           </tr>
    	
          <%for(TADutiesInfo tInfo: TAInfo ) {%>
           <tr>
           
           		<td><label class="radio" onclick=""> 
					<input type="radio" name="courseNumber" value="<%=tInfo.division%>/<%=courseNumber%>/<%=sectionNumber%>/<%=TAID%>/<%=tInfo.COGSName%>" />
				</label></td>
				<td><%=tInfo.COGSName%></td>
				<td><%=tInfo.division%></td>
				<td>
					<%for(int i=0; i<tInfo.firstNames.size(); i++) {%>
						<%=tInfo.firstNames.get(i)%> <%=tInfo.lastNames.get(i)%><br>
					<%}%>
				</td>
				<td>
					<%for(int i=0; i<tInfo.groupNumbers.size(); i++) {%>
						<%=tInfo.groupNumbers.get(i)%><br>
					<%}%>
				</td>
				<td><%=tInfo.question%></td>
				<td>
					<%for(int i=0; i<tInfo.rooms.size(); i++) {%>
						<%=tInfo.rooms.get(i)%><br>
					<%}%>
				</td>
				<td>
					<%for(int i=0; i<tInfo.StartTimes.size(); i++) {%>
						<%=tInfo.StartTimes.get(i)%><br>
					<%}%>
				</td>
				<td>
					<%for(int i=0; i<tInfo.EndTimes.size(); i++) {%>
						<%=tInfo.EndTimes.get(i)%><br>
					<%}%>
				</td>
           </tr>
          <%} %>
         </table>  
       </div>
    </td>
  </tr>
</table>
				<input type = "hidden" name = "empty" value = <%=empty%>>
				<input type = "hidden" name = "firstname" value = <%=firstname%>>
				<input type = "hidden" name = "lastname" value = <%=lastname%>>	
				<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
				<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>	
				<input type="submit"  name = "button" value="Make Assessment" onclick="return ViewValidation()"/>
</form>

<form action="TAMakeAssessmentsServlet" id="myform1" method="get">
<table cellspacing="0" cellpadding="0" border="0" width="325" class="striped" border=1>
  <tr>
    <td>
       <table cellspacing="0" cellpadding="1" border="0" width="300"class="striped" border=1 >
         <tr>
            <th>Completed Assessments</th>
         </tr>
       </table>
    </td>
  </tr>
  <tr>
    <td>
       <div style="100%; height:250px; width: 1000px; overflow:auto;">
         <table class="fixed" cellspacing="0" cellpadding="1" border="0" width="300" class="striped" border=1>
           <tr>
           		<td><b></b></td>
				<td><b>COGS name</b></td>
				<td><b>Division </b></td>
				<td><b>Student Names</b></td>
				<td><b>Group Number</b></td>
				<td><b>Questions</b></td>
				<td><b>Room</b></td>
				<td><b>Start Time</b></td>
				<td><b>End Time</b></td>
           </tr>
          <%for(TADutiesInfo tInfo: cInfo ) {%>
           <tr>
           
           		<td><label class="radio" onclick=""> 
					<input type="radio" name="courseNumber" value="<%=tInfo.division%>/<%=courseNumber%>/<%=sectionNumber%>/<%=TAID%>/<%=tInfo.COGSName%>" />
				</label></td>
				<td><%=tInfo.COGSName%></td>
				<td><%=tInfo.division%></td>
				<td>
					<%for(int i=0; i<tInfo.firstNames.size(); i++) {%>
						<%=tInfo.firstNames.get(i)%> <%=tInfo.lastNames.get(i)%><br>
					<%}%>
				</td>
				<td>
					<%for(int i=0; i<tInfo.groupNumbers.size(); i++) {%>
						<%=tInfo.groupNumbers.get(i)%><br>
					<%}%>
				</td>
				<td><%=tInfo.question%></td>
				<td>
					<%for(int i=0; i<tInfo.rooms.size(); i++) {%>
						<%=tInfo.rooms.get(i)%><br>
					<%}%>
				</td>
				<td>
					<%for(int i=0; i<tInfo.StartTimes.size(); i++) {%>
						<%=tInfo.StartTimes.get(i)%><br>
					<%}%>
				</td>
				<td>
					<%for(int i=0; i<tInfo.EndTimes.size(); i++) {%>
						<%=tInfo.EndTimes.get(i)%><br>
					<%}%>
				</td>
           </tr>
          <%} %>
         </table>  
       </div>
    </td>
  </tr>
</table>
				<input type = "hidden" name = "firstname" value = <%=firstname%>>
				<input type = "hidden" name = "lastname" value = <%=lastname%>>	
				<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
				<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>
				<input type="submit"  name = "button" value="Modify Grades" onclick="return ViewValidation()"/>	
</form>
</div>
	</div>
	<div id="footer">
			&copy;UBC Electrical and Computer Engineering. Styled with <a
				href="http://metroui.org.ua">Metro UI CSS</a>
		</div>
</div>
</body>
</html>